package com.itheima.reggie.common;

import com.itheima.reggie.domain.Employee;


/**
 * ThreadLocal线程
 *
 * @Author Yang
 * @Date 2023/3/4 16:20
 */
public class EmployeeHolder {
    private static final ThreadLocal<Employee> TL = new ThreadLocal<>();

    //新增
    public static void set(Employee employee) {
        TL.set(employee);
    }

    //获取
    public static Employee get() {
        return TL.get();
    }

    //销毁
    public static void remove(){
        TL.remove();
    }
}
